import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/*
/todo/
/todo?id=3456
/todo/34567
*/

export default new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/home',
      redirect: '/'
    },
    {
      path: '/',
      name: 'home',
      component: () => import('./pages/Home')
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('./pages/About')
    },
    {
      path: '/user/:user_id',
      name: 'user',
      props: (route) => {
        return {
          id: route.params.user_id
        }
      },
      component: () => import('./pages/User')
    },
    {
      path: '*',
      name: '404',
      component: () => import('./pages/NotFound')
    }
  ]
})




